{% extends "generic/_list.html" %}

                        {% block list_table %}
                            <table class="table table-striped table-bordered table-hover dataTables-example">
                                <thead>
                                <tr>
                                    <th width="20"><input type="checkbox" id="CheckedAll"></th>
                                    <th>名称</th>
                                    <th>网站用户</th>
                                    <th>用户组</th>
                                    <th>机组</th>
                                    <th>主机</th>
                                    <th>主机用户</th>
                                    <th>启用</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>

                                {% for object in object_list %}

                                    <tr id="{{ object.id }}">
                                        <td><input type="checkbox" value="{{ object.id }}"  name="id"></td>
                                        <td class="center">{% url viewname_update object.id as obj_update %}
                                            <a href="{{ obj_update }}">{{ object.name }}</a>
                                        </td>

                                        <td>
                                        {% if object.web_user.count > 5 %}
                                            (共 {{ object.web_user.count }} 个)
                                        {% else %}
                                            {% for i in object.web_user.all %}
                                            <i class="fa fa-user"></i> {{ i }}<br/>
                                            {% empty %}
                                            未设置
                                            {% endfor %}
                                        {% endif %}
                                        </td>

                                        <td>
                                        {% if object.web_usergroup.count > 5 %}
                                            (共 {{ object.web_usergroup.count }} 个)
                                        {% else %}
                                            {% for i in object.web_usergroup.all %}
                                            <i class="fa fa-users"></i> {{ i }}<br/>
                                            {% empty %}
                                            未设置
                                            {% endfor %}
                                        {% endif %}
                                        </td>


                                        <td>
                                        {% if object.hostgroup.count > 5 %}
                                            (共 {{ object.hostgroup.count }} 个)
                                        {% else %}
                                            {% for i in object.hostgroup.all %}
                                            <i class="fa fa-cubes"></i> {{ i }}<br/>
                                            {% empty %}
                                            未设置
                                            {% endfor %}
                                        {% endif %}
                                        </td>

                                        <td>
                                        {% if object.host.count > 5 %}
                                            (共 {{ object.host.count }} 台)
                                        {% else %}
                                            {% for i in object.host.all %}
                                            <i class="fa fa-laptop"></i> {{ i }}<br/>
                                            {% empty %}
                                            未设置
                                            {% endfor %}
                                        {% endif %}
                                        </td>

                                        <td>
                                        {% if object.host_user.count > 5 %}
                                            (共 {{ object.host_user.count }} 个)
                                        {% else %}
                                            {% for i in object.host_user.all %}
                                            <i class="fa fa-user-secret"></i> {{ i }}<br/>
                                            {% empty %}
                                            未设置
                                            {% endfor %}
                                        {% endif %}
                                        </td>


                                        <td class="center"><i class="fa fa-{% if object.enable %}check-square text-navy{% else %}minus-square text-danger{% endif %}"></i></td>
                                        <td>
                                            <a class="btn btn-danger btn-xs">删除</a>

                                        </td>
                                    </tr>
                                {% endfor %}

                                </tbody>

                            </table>

                        {% endblock %}


